<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>意见反馈</title>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<link href="/carworld_weixin/css/advice-style.css" rel="stylesheet" type="text/css">
<script src="/carworld_weixin/js/jquery-3.3.1.min.js"></script>
<style type="text/css">
.tb960x90 {
	display: none !important;
	display: none
}
</style>
</head>
<body>

	<section class="aui-flexView">
		<header class="aui-navBar aui-navBar-fixed">
			<a href="javascript:history.back(-1)" class="aui-navBar-item">
				<i class="icon icon-return"></i>
			</a>
			<div class="aui-center">
				<span class="aui-center-title">意见反馈</span>
			</div>
			<a href="javascript:;" class="aui-navBar-item">
				<i class="icon icon-sys"></i>
			</a>
		</header>
		<section class="aui-scrollView">
			<div class="aui-view-box">
				<div class="aui-view-box-item">
					<h2>您的问题或建议:</h2>
					<textarea id="content"></textarea>
					<div class="aui-view-box-item">
						<p>输入个人意见反馈,字数在200字以内</p>
					</div>
				</div>
				<div class="aui-view-box-item">
					<h2>您的联系方式:</h2>
					<input type="text" placeholder="输入电话号码或微信号" id="telephone">
				</div>
				<div class="aui-view-box-item">
					<p>留下您的联系方式,以便我们了解问题后及时反馈和结果，紧急问题请联系门店。</p>
				</div>
				<div class="aui-btn-submit">
					<button id="submit">提交建议</button>
				</div>
			</div>
		</section>
		<footer class="aui-footer aui-footer-fixed">
			<p>
				<span>
					遇到问题了？ 拨打门店电话
					<em>(02)89580828</em>
				</span>
			</p>
		</footer>
	</section>

	<script>
		$("#submit").click(function() {
			var content = $("#content").val();
			var telephone = $("#telephone").val();
            content=encodeURIComponent(content);
			console.log('content:'+content);


			if (content == '' || telephone == '') {
				alert('请填写完整哦~');
				return;
			}
			$.ajax({
                type : 'get',
				url : '/carworld_weixin/advice/saveAdvice',
				data : {
					content: content,
					telephone : telephone
				},
				dataType : 'text',
				contentType : 'application/json',
				success : function(data) {
					alert(data);
					window.location.reload();
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert("后台繁忙~");
				}

			});

		})
	</script>

</body>
</html>